package com.vietnam.power.domain;

import java.util.Date;

public class UserInfo {
	private Integer id;
	private boolean accountNonExpired;
	private boolean accountNonLocked;
	private String country;
	private String countryCode;
	private Date createdDate;
	private String email;
	private boolean enabled;
	private String firstName;
	private String gender;
	private String lastName;
	private short loginAttempts;
	private String password;
	private boolean passwordNonExpired;
	private String phone;
	private String timezone;
	private Date updatedDate;
	private String userName;
	private int avatarId;

	public UserInfo() {
	}

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public boolean getAccountNonExpired() {
		return this.accountNonExpired;
	}

	public void setAccountNonExpired(boolean accountNonExpired) {
		this.accountNonExpired = accountNonExpired;
	}

	public boolean getAccountNonLocked() {
		return this.accountNonLocked;
	}

	public void setAccountNonLocked(boolean accountNonLocked) {
		this.accountNonLocked = accountNonLocked;
	}

	public String getCountry() {
		return this.country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getCountryCode() {
		return this.countryCode;
	}

	public void setCountryCode(String countryCode) {
		this.countryCode = countryCode;
	}

	public Date getCreatedDate() {
		return this.createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public boolean getEnabled() {
		return this.enabled;
	}

	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}

	public String getFirstName() {
		return this.firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getGender() {
		return this.gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public String getLastName() {
		return this.lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public short getLoginAttempts() {
		return this.loginAttempts;
	}

	public void setLoginAttempts(short loginAttempts) {
		this.loginAttempts = loginAttempts;
	}

	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public boolean getPasswordNonExpired() {
		return this.passwordNonExpired;
	}

	public void setPasswordNonExpired(boolean passwordNonExpired) {
		this.passwordNonExpired = passwordNonExpired;
	}

	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getTimezone() {
		return this.timezone;
	}

	public void setTimezone(String timezone) {
		this.timezone = timezone;
	}

	public Date getUpdatedDate() {
		return this.updatedDate;
	}

	public void setUpdatedDate(Date updatedDate) {
		this.updatedDate = updatedDate;
	}

	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public int getAvatarId() {
		return avatarId;
	}

	public void setAvatarId(int avatarId) {
		this.avatarId = avatarId;
	}

	public void convertToDomain(com.vietnam.power.persitence.UserInfo u) {
		this.id = u.getId();
		this.firstName = u.getFirstName();
		this.lastName = u.getLastName();
		this.email = u.getEmail();
		this.countryCode = u.getCountryCode();
		this.phone = u.getPhone();
		if (u.getAvatarId() != null) {
			this.avatarId = u.getAvatarId().getId();
		}
		this.gender = u.getGender();
		this.timezone = u.getTimezone();
		this.userName = u.getUserName();
		this.country = u.getCountry();
		this.enabled = u.getEnabled();
	}
	
	public void convertToPersist(com.vietnam.power.persitence.UserInfo u) {
		u.setFirstName(this.firstName);
		u.setLastName(this.lastName);
		u.setEmail(this.email);
		u.setCountryCode(this.countryCode);
		u.setPhone(this.phone);
		u.setGender(this.gender);
		u.setTimezone(this.timezone);
		u.setCountry(this.country);
		u.setEnabled(this.enabled);
	}
}